package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.model.VipModelImpl;
import com.sphd.beautysalon.view.VipView;
import com.sphd.beautysalon.info.VipInfo;

import java.util.List;

/**
 * Created by Hu on 2016/11/09
 */

public class VipPresenterImpl implements VipPresenter {
    VipModelImpl vipModel;
    VipView vipView;

    public VipPresenterImpl(VipView vipView) {
        this.vipView = vipView;
        vipModel=new VipModelImpl();
    }

    @Override
    public void addData(String url) {
        vipView.showLoading();
        vipModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
        vipView.dissLoading();
    }

    @Override
    public void sendRes(int com, int dis, int topup,int topupno) {
        vipView.recRes(com,dis,topup,topupno);
    }

    @Override
    public void sendList(List<VipInfo> vipInfos) {
        vipView.recList(vipInfos);
        vipView.dissLoading();
    }

    @Override
    public void delUrl(String url) {
        vipModel.delUrl(url,this);
    }

    @Override
    public void recRes(int res) {
        vipView.recDelRes(res);
    }
}